-
Notifications
You must be signed in to change notification settings - Fork 255
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refine error message of invalid database url #4340
Conversation
CodSpeed Performance ReportMerging #4340 will not alter performanceComparing Summary
|
Are you sure the test would have surfaced the previous error message that is mentioned in the issue this is supposed to solve? |
@janpio According to my understanding of the code flow, the original error comes from the spot where the test covers. The traceroute goes:
That being said, a direct reproduction from |
To me it looks like the error message that prisma/prisma#20230 talks about is based on this one, but additionally modified and expanded into weird grammar and wording. So I would not expect this PR to actually fix the problem, jsut to replace part of the message. |
@janpio Sorry I missed out the grammar part of the problem. The wording of the error message is fixed. now the full message is
|
I don't think that makes a difference. The issue has a lot more text before and after the error message you edited here, at least in the issue. If that is still valid, then your change will not fix that. To make more concrete:
This is the problematic error message in the issue prisma/prisma#20230 This PR only modifies the bolded part of my quote above. I do not understand how the cut off sentence "in database URL" would be fixed by this PR. |
@janpio I am not sure I understand your requirement. The text before and after it seem meaningful to me. Are you demanding to remove all the complementary text before and after the core text in the error message? Say the full error message: |
What I did in this PR is simply changing the core part of the error message, so that the final error message makes sense when combined with the prefix and postfix |
Ok, I understand now - the replaced error message changes the wording in a way that ending the message with We don't want to hardcode the list of expected schemes as |
@janpio Exactly. The
Please review again as the error message is rephrased to remove the hard-coded list of supported schemes. The full message is now:
|
Not the best grammar, but with the hardcoded "in database Url" is is hard to get something better. |
@janpio there are quite a lot of places that have been using the formatter. The defining function has 19 references that calls it. One example is in postgres_setup. I don't have an example of the final error message yet. It seems that all the errors relating to url parsing are wrapped in the same format. One way to fix the grammar is to remove the We may get more insights from the owner of this module. The original commit is authored by @tomhoule |
There should be end to end tests for the messages. If there aren't, they could be written. |
cool. I can help with this. I imagine there are many diverse messages across the codebase that are not covered by test yet. To get started we can try to thoroughly test the url parsing error messages first. Is there a template e2e test that sets up the test in the way we like? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Final formatting changes: https://github.com/prisma/prisma-engines/actions/runs/6694206883/job/18186985205?pr=4340
fix prisma/prisma#20230
Changes